package com.test.io.propertiesDemo;

import org.junit.Test;

import java.io.FileWriter;
import java.io.IOException;
import java.util.Properties;

/**
 * @version 1.0
 * @Author: 许啸林 使用
 * @Date: 2021/6/4 16:39
 */
public class PropertiesWriteDemo {
    @Test
    public void pwrite() {
        Properties properties = new Properties();
        properties.setProperty("name","张三");
        properties.setProperty("age", "21");
        properties.setProperty("height", "25");
        try {
            properties.store(new FileWriter("src//my2.properties"), "asda");
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
        }
    }
}
